<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>创建一个新的时间戳。</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.mongotimestamp.html">MongoTimestamp</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongotimestamp.tostring.html">MongoTimestamp::__toString</a></div>
 <div class="up"><a href="class.mongotimestamp.html">MongoTimestamp</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mongotimestamp.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoTimestamp::__construct</h1>
  <p class="verinfo">(PECL mongo &gt;= 1.0.1)</p><p class="refpurpose"><span class="refname">MongoTimestamp::__construct</span> &mdash; <span class="dc-title">创建一个新的时间戳。</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongotimestamp.construct-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>MongoTimestamp::__construct</strong></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$sec</code><span class="initializer"> = time()</span></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$inc</code></span>
  ]] )</div>

  <p class="para rdfs-comment">
   创建一个新的时间戳。如果没有指定参数，将使用当前的时间戳，也会自动提供增量。
   模块加载时增量设置为 0，并且在每次调用构造器时自动增加（没有传入 $inc 参数时）。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongotimestamp.construct-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>

      <em><code class="parameter">sec</code></em>
     </dt>

     <dd>

      <p class="para">
       自 1970 年 1 月 1 日以来的秒数。
      </p>
     </dd>

         
    
     <dt>

      <em><code class="parameter">inc</code></em>
     </dt>

     <dd>

      <p class="para">
       增量。
      </p>
     </dd>

         
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongotimestamp.construct-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回新的 timestamp。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongotimestamp.construct-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="mongotimestamp.tostring.html" class="methodname" rel="rdfs-seeAlso">MongoTimestamp::__toString()</a> - 返回时间戳的字符串表示形式</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="class.mongotimestamp.html">MongoTimestamp</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mongotimestamp.tostring.html">MongoTimestamp::__toString</a></div>
 <div class="up"><a href="class.mongotimestamp.html">MongoTimestamp</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
